<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="csrf-token" content="{{ csrf_token() }}" />
	<link type="text/css" rel="stylesheet" href="/home/juse/css/style.css" />
    <!--[if IE 6]>
    <script src="/home/juse/js/iepng.js" type="text/javascript"></script>
        <script type="text/javascript">
           EvPNG.fix('div, ul, img, li, input, a'); 
        </script>
    <![endif]-->    

    <script type="text/javascript" src="/home/juse/js/jquery-1.11.1.min_044d0927.js"></script>
    <script type="text/javascript" src="/home/juse/js/jquery.bxslider_e88acd1b.js"></script>
    
    <script type="text/javascript" src="/home/juse/js/jquery-1.8.2.min.js"></script>
    <script type="text/javascript" src="/home/juse/js/menu.js"></script>    
        
    
    
    <script type="text/javascript" src="/home/juse/js/iban.js"></script>
    <script type="text/javascript" src="/home/juse/js/fban.js"></script>
    <script type="text/javascript" src="/hseome/juse/js/f_ban.js"></script>
    <script type="text/javascript" src="/home/juse/js/mban.js"></script>
    <script type="text/javascript" src="/home/juse/js/bban.js"></script>
    <script type="text/javascript" src="/home/juse/js/hban.js"></script>
    <script type="text/javascript" src="/home/juse/js/tban.js"></script>
    
	


    <script type="text/javascript" src="{{asset('layer/layer.js')}}"></script>


    <script type="text/javascript" src="/home/juse/js/jquery-1.8.2.min.js"></script>
    <script type="text/javascript" src="/home/juse/js/menu.js"></script>    
            
    <script type="text/javascript" src="/home/juse/js/lrscroll_1.js"></script>   
     
    
    <script type="text/javascript" src="/home/juse/js/n_nav.js"></script>
    
    <link rel="stylesheet" type="text/css" href="/home/juse/css/ShopShow.css" />
    <link rel="stylesheet" type="text/css" href="/home/juse/css/MagicZoom.css" />
    <script type="text/javascript" src="/home/juse/js/MagicZoom.js"></script>
    
    <script type="text/javascript" src="/home/juse/js/num.js">
        var jq = jQuery.noConflict();
    </script>
        
    
    <script type="text/javascript" src="/home/juse/js/shade.js"></script>

    





    @section('style')
    @show

    <style>
        .pagination{
            overflow:hidden; color:#888888; padding:20px 10px; text-align:right; font-size:16px; font-family:"宋体"; margin-top:20px;
        }
        .pagination li{
            height:36px; line-height:36px; overflow:hidden; color:#666666; font-size:16px; text-align:center; display:inline-block; padding:0 12px; margin:0 4px; border:1px solid #cccccc; -webkit-border-radius:2px; -moz-border-radius:2px; border-radius:2px;
        }
        .pagination li:hover, .pagination li.active{
            color:#FFF; background-color:#ff4e00; border:1px solid #ff4e00; 
        }

        .pagination li.disabled:hover{
            cursor: no-drop;
            background-color:#eaeaea; color:#555555; border:1px solid #cccccc;
        }
    </style>
      <script type="text/javascript" src="/home/juse/js/menu.js"></script>    
	<script type="text/javascript" src="/home/juse/js/select.js"></script>
	<style>
		#userpic{
			width: 190px;
			height: 190px;
			border-radius: 50%;
			margin-left: 10px;
			margin-top: 5px;
		}
		#username{
			font-size: 16px;
			font-weight: bold;
			width: 100%;
		}
		#ulul li{
			font-size: 16px;
			border:1px solid #fff;
			border-radius: 50%;
		}

		#logo{
			width: 280px;
			margin: auto;
			float: left;
		}
		.m_top_bg{
			width: 98%;
			border-radius: 10px;
		}
		#form{
			width: 385px;
			border: 1px solid #ccc;
			float: right;
			margin-top: 50px;
			margin-right: 50px;
		}
		.buttonedit{
			width: 45px;
			height: 25px;
			font-weight: bold;
			background: #0af;
			border: 0px solid ;
			border-radius: 5px;
		}
		.buttondel{
			width: 45px;
			font-weight: bold;
			height: 25px;
			background: #ff971f;
			border: 0px solid ;
			border-radius: 5px;
		}
		.buttonedit,.buttondel,.butt{
			cursor: pointer;
		}
		
	</style>



<title>木鱼</title>

</head>
<body> 
@if (count($errors) > 0)
    <script>
    $(function(){
        layer.msg('{{ $errors }}',{icon: 5});
    })
    </script>
@endif 
<!--Begin Header Begin-->

@if(session('huser'))
    <div class="soubg">

        <div class="sou">
        <a href="/"><span>首页</span></a>

            <span class="fr">
                <span class="f1">欢迎您,<a href="#" style="color:#ff4e00;">
                @if(empty(session('huser')['username']))
                    {{session('huser')['phone']}}
                @else
                    {{session('huser')['username']}}
                @endif
                </a>　<a href="/user">个人中心</a>　<a href="#">我的鱼塘</a>　<a href="/logout">退出</a></span>


            </span>
        </div>
    </div>
@else

    <div class="soubg">
        <div class="sou">
            <a href="/"><span>首页</span></a>
            <span class="fr">
                <span class="fl">你好，请<a href="/login">登录</a>&nbsp; <a href="/register" style="color:#ff4e00;">免费注册</a>&nbsp;|&nbsp;<a href="/home/juse/#">个人中心</a>&nbsp;|　<a href="/home/juse/#">我的鱼塘</a></span>
                
            </span>
        </div>
    </div>
@endif<link rel="stylesheet" href="/bootstrap-3.3.7-dist/css/bootstrap.min.css">  
    <link rel="stylesheet" href="/home/juse/css/publish.css" />
    <style>
		

		#logo{
			width: 280px;
			margin: auto;
			float: left;
		}
		.m_top_bg{
			width: 98%;
			border-radius: 10px;
		}
		#form{
			width: 367px;
			border: 1px solid #ccc;
			float: right;
			margin-top: 50px;
			margin-right: 50px;
		}
	</style>



<script src="/home/area.js"></script>
	<div class="m_top_bg">
    <div class="top">
        <a href="/"><img id="logo" src="/home/media/image/logo.png" alt="logo"></a>
        <div id="form">
	        <form >
	            <input type="text" value="" name="search" class="m_ipt" placeholder='请输入您想要的商品'>
	            <input type="submit" value="搜索" class="m_btn">
	        </form>
        </div>
    </div>
</div>
	
	<div class="pub_content" style="width:800px">
		<form class="form-horizontal" id="pub_content" action="/publish" method="post" enctype="multipart/form-data">
		{{ csrf_field() }}
		<div class="form-group">
		    <label for="inputEmail3" class="col-sm-2 control-label">商品名称</label>
		    <div class="col-sm-10">
		    <input type="hidden" name="pic" id="art_thumb">
		      <input class="btn btn-default" id="file_upload" name="file_upload" type="file" class="form-control" id="inputEmail3" style="width:200px;" placeholder="请选择图片">
		      <p><img  id="img1" alt="上传后显示图片"  style="max-width:350px;max-height:100px;" /></p>
		    </div>

		  </div>
	    <div class="form-group">
		    <label for="inputEmail3" class="col-sm-2 control-label">选择地区</label>
		    <div class="col-sm-10">
		      <select  class="btn btn-default"id="Province" runat="server" name="province" style="width: 110px" ></select>
				<select class="btn btn-default" id="Country" runat="server" name="country" style="width: 110px"></select>
				<select class="btn btn-default" id="Town" runat="server" name="town" style="width: 110px"></select>
		    </div>
		     <script language="javascript">
				setup();
			    </script>
		  </div>
		  <div class="form-group">
		    <label for="inputEmail3" class="col-sm-2 control-label">选择分类</label>
		    <div class="col-sm-10">
		      <select class="btn btn-default" id="ptype" runat="server" name="ptype" style="width: 110px" >
			      	<option class="ptype" value="">--请选择--</option>
			      @foreach($ptype as $v)
			      	<option class="ptype" value="{{ $v['id'] }}">{{$v['name']}}</option>
			      @endforeach
		      </select>
				<select  id="stype" class="btn btn-default"  runat="server" name="stype" style="width: 110px">
					<option class="ptype" value="">--请选择--</option>
				</select>
		    </div>
		     
		  </div>
		  <div class="form-group">
		    <label for="inputEmail3" class="col-sm-2 control-label">商品名称</label>
		    <div class="col-sm-10">
		      <input name="title" type="text" class="form-control" id="name" placeholder="请输入商品名">
		    </div>

		  </div>
		   <div class="form-group" >
		    <label for="inputEmail3" class="col-sm-2 control-label">商品价格</label>
		    <div class="col-sm-10">
		      <input name="reprice" style="width:200px" type="number" class="form-control" id="reprice" placeholder="请输入商品价格">
		    </div>
		  </div>
		  <div class="form-group" >
		    <label for="inputEmail3" class="col-sm-2 control-label">商品原价</label>
		    <div class="col-sm-10">
		      <input name="price" style="width:200px" type="number" class="form-control" id="inputEmail3" placeholder="请输入商品原价">
		    </div>
		  </div>
		  
		  <div class="form-group">
		    <label for="inputEmail3" class="col-sm-2 control-label">选择成色</label>
		    <div class="col-sm-10">
		      <select class="btn btn-default" id="condition" runat="server" name="condition" style="width: 200px" >
			      	<option   value="">--请选择--</option>
			      	<option  value="0">九九新</option>
			      	<option  value="1">九成新</option>
			      	<option  value="2">八成新</option>
			      	<option  value="3">七成新</option>
			      
		      </select>
				
		    </div>
		     
		  </div>
		  <div class="form-group" >
		    <label for="inputEmail3" class="col-sm-2 control-label">商品描述</label>
		    <div class="col-sm-10">
		      <textarea name="intro" id="" cols="91" rows="6" placeholder="请输入商品描述"></textarea>
		    </div>
		  </div>
		   
		  <div class="form-group">
		    <div class="col-sm-offset-2 col-sm-10">
		      <button type="submit" class="btn btn-info" style="width:200px;">发布</button>
		    </div>
		  </div>
		</form>
	</div>
	<script>
		$('#ptype').change(function(){
			$.get('/publish/pid?pid='+$(this).val(),function(msg){
				$('#stype').html(msg)
			})
		})
	</script>

	<!-- 文件上传 -->
	<script type="text/javascript">
        $(function () {
            $("#file_upload").change(function () {
                uploadImage();
            });
        });

        function uploadImage() {
//          判断是否有选择上传文件
            var imgPath = $("#file_upload").val();
            if (imgPath == "") {
                alert("请选择上传图片！");
                return;
            }
            //判断上传文件的后缀名
            var strExtension = imgPath.substr(imgPath.lastIndexOf('.') + 1);
            if (strExtension != 'jpg' && strExtension != 'gif'
                && strExtension != 'png' && strExtension != 'bmp') {
                alert("请选择图片文件");
                return;
            }
//          var myform = document.getElementById('art_from');
            var formData = new FormData($('#pub_content')[0]);
            formData.append('_token', '{{csrf_token()}}');
                                        {{--console.log(formData);--}}
            $.ajax({
                type: "POST",
                url: "/publish/upload",
                data: formData,
                async: true,
                cache: false,
                contentType: false,
                processData: false,
                success: function(data) {
                                   // console.log(data);
//                                    alert("上传成功");
//                    $('#img1').attr('src','http://ovf9o4wws.bkt.clouddn.com/'+data);
//                    http://project187.oss-cn-shanghai.aliyuncs.com/uploads/201708290957357759.jpg
                   $('#img1').attr('src','/'+data);
                    $('#art_thumb').val(data);

                },
                error: function(XMLHttpRequest, textStatus, errorThrown) {
                    alert("上传失败，请检查网络后重试");
                }
            });
        }

    </script>
	<script>
		$(function(){
			$('.btn-info').click(function(){

				//检测图片
				if($('#art_thumb').val()=='' || $('#art_thumb').val() == undefined){
					return layer.tips('选择图片', '#img1'),false;
				}	
				//检测地区
				// alert($('#Town').val())
				if($('#Town').val()=='' || $('#Town').val() == undefined || $('#Town').val() == '县市'){
					$('#Province').focus();
					return layer.tips('请选择地区', '#Town'),false;
				}
				//检测分类
				if($('#stype').val()=='' || $('#stype').val() == undefined || $('#stype').val() == '--请选择--'){
					$('#ptype').focus();
					return layer.tips('请选择分类', '#stype'),false;
				}
	  			//检测商品名
				if($('#name').val()=='' || $('#name').val() == undefined){
					$('#name').focus();
					return layer.tips('请输入商品名', '#name'),false;
				}	
				//检测价格
				if($('#reprice').val()=='' || $('#reprice').val() == undefined){
					$('#reprice').focus();
					return layer.tips('请输入价格', '#reprice'),false;
				}
				//检测地区
				// alert($('#Town').val())
				if($('#condition').val()=='' || $('#condition').val() == undefined || $('#condition').val() == '县市'){
					$('#condition').focus();
					return layer.tips('请选择成色', '#condition'),false;
				}
	  		});
		})

		
			

	</script>



 <!--Begin Link Begin -->
    <div class="btmbg">
    <div class="b_link">
        
            <b>友情链接:</b> 
            @foreach($link as $k=>$v)

            <tr><a href="{{url($v['url'])}}">{{$v['title']}}&nbsp|&nbsp</a></tr>
            
            @endforeach
        

    </div>
<!--End Link End--> 
    
		<div class="btm">
        	备案/许可证编号：蜀ICP备12009302号-1-www.dingguagua.com   Copyright © 2015-2018 尤洪商城网 All Rights Reserved. 复制必究 , Technical Support: Dgg Group <br />
            <img src="/home/juse/images/b_1.gif" width="98" height="33" /><img src="/home/juse/images/b_2.gif" width="98" height="33" /><img src="/home/juse/images/b_3.gif" width="98" height="33" /><img src="/home/juse/images/b_4.gif" width="98" height="33" /><img src="/home/juse/images/b_5.gif" width="98" height="33" /><img src="/home/juse/images/b_6.gif" width="98" height="33" />
        </div>    	
    </div>
    <!--End Footer End -->    
</div>

</body>


<!--[if IE 6]>
<script src="/home/juse///letskillie6.googlecode.com/svn/trunk/2/zh_CN.js"></script>
<![endif]-->
</html>
